//
//  CircleController.m
//  BeautyBaoUnion
//
//  Created by 肖智 on 2016/10/25.
//  Copyright © 2016年 肖智. All rights reserved.
//

#import "CircleController.h"
#import "MoveItemController.h"
#import "CircleView.h"
#import "CardView.h"
@interface CircleController (){
    CircleView *_circle;
    CardView *_cardView;
}

@end

@implementation CircleController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];

    _cardView = [[CardView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.width*0.6+20)];
    [_cardView layoutItemWithData:@[@"a",@"b",@"c",@"d",@"e"]];
    [self.view addSubview:_cardView];
    
    _circle = [[CircleView alloc] initWithFrame:CGRectMake(0, 0, 250, 172)];
    _circle.center = CGPointMake(self.view.bounds.size.width/2.0, self.view.bounds.size.height/2.0+100);
    [_circle layoutWithLevelValueArray:@[@"0",@"500",@"1000",@"1500",@"2000"]];
    [self.view addSubview:_circle];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(100, 100, 50, 30);
    btn.backgroundColor = [UIColor lightGrayColor];
    [btn addTarget:self action:@selector(beginAnimation) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    // Do any additional setup after loading the view.
}
- (void)beginAnimation{
//    [_circle setPercent:0.5];
    MoveItemController *clt = [[MoveItemController alloc] init];
    [self.navigationController pushViewController:clt animated:YES];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)dealloc{
    NSLog(@"CircleController dealloc");
    [_cardView willDealloc];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
